Page({
  data: {
    idNumber: '',
    name: '',
    gender: '',
    dob: '',
    ethnicity: '',
    politicalStatus: ''
  },
  handleInput(e) {
    const field = e.currentTarget.dataset.field;
    this.setData({ [field]: e.detail.value });
  },
  handleGenderChange(e) {
    this.setData({ gender: e.detail.value });
  },
  nextPage() {
    const exam_candidate_info = {
      idNumber: '',
    name: '',
    gender: '',
    dob: '',
    ethnicity: '',
    politicalStatus: '',
    college: '',
    major: '',
    candidateType: '',
    appliedMajor: '',
    volunteerCollege: '',
    volunteerMajor:'',
    foreignLanguage: '',
    examLocation: ''
    };
    Object.assign(exam_candidate_info, {
      idNumber: this.data.idNumber,
      name: this.data.name,
      gender: this.data.gender,
      dob: this.data.dob,
      ethnicity: this.data.ethnicity,
      politicalStatus: this.data.politicalStatus
    });
    
    wx.setStorageSync('exam_candidate_info', exam_candidate_info);
    wx.navigateTo({
      url: '../page2/page2'
    });
  }
});